<template>
  <teleport to="#back">
    <div
      :style="{ backgroundColor: background }"
      class="d-flex justify-content-center align-items-center h-100 loading-container"
    >
      <div class="loading-content">
        <div class="spinner-border color-load" role="status"></div>
        <p v-if="text" class=" small color-load">{{ text }}</p>
      </div>
    </div>
  </teleport>
</template>


<script>
import useDOMCreate from "../hooks/useDOMCreate";
import { defineComponent } from "vue";
export default defineComponent({
  props: {
    text: {
      type: String,
    },
    background: {
      type: String,
    },
  },
  setup() {
    useDOMCreate("back");
  },
});
</script>


<style>
.loading-container {
  background: rgba(12, 12, 12, 0.5);
  z-index: 100;
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

.loading-container {
  text-align: center;
}
.color-load {
  color: #fff;
}
</style>
